import Vue from 'vue'
import Router from 'vue-router'
import AttendenceOnce from '@/components/AttendenceOnce'
import AttendenceEx from '@/components/AttendenceEx'
import UnAvailable from '@/components/UnAvailable'
import ManageGuide from '@/components/ManageGuide'
import AddGroup from '@/components/groupMrg/AddGroup'
import AddGroupOne from '@/components/groupMrg/addGroupStepOne'
import AddGroupTwo from '@/components/groupMrg/addGroupStepTwo'
// 创建考勤
import NewAttendence from '@/components/NewAttendence'
//考勤人员
import CheckAttenPerson from '@/components/groupMrg/CheckAttenPerson'
// 考勤地点
import MapPosition from '@/components/MapPosition'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'AttendenceOnce',
      component: AttendenceOnce
    },
    {
      path: '/new_attendence',
      name: 'NewAttendence',
      component: NewAttendence
    },
    // 考勤人员
    {
      path: '/new_attendence/check_attenPersons',
      name: 'CheckAttenPerson',
      component: CheckAttenPerson
    },
    // 考勤地点
    {
      path: '/mapPosition/:id',
      name: 'MapPosition',
      component: MapPosition
    },
    {
      path: '/attendence',
      name: 'AttendenceEx',
      component: AttendenceEx
    },
    {
      path: '/attendence/UnAvailable',
      name: 'UnAvailable',
      component: UnAvailable
    },
    {
      path: '/attendence/ManageGuide',
      name: 'ManageGuide',
      component: ManageGuide
    },
    {
      path: '/addGroup',
      name: 'AddGroup',
      component: AddGroup,
      children: [
        {
          path: 'step1',
          name: 'AddGroupOne',
          component: AddGroupOne
        },
        {
          path: 'step2',
          name: 'AddGroupTwo',
          component: AddGroupTwo
        }
      ]
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
   }
})
